/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package Presentacion;

import java.awt.Dimension;
import java.awt.Toolkit;
import java.awt.Window;

/**
 *
 * @author David
 */
public class Principal extends javax.swing.JFrame {

    /**
     * Creates new form Principal
     */
    private ConectadoGUI conectado;
    private Conexion conexion;
    private Catalogo catalogo;
    private Users usuarios;
    private LogminerGUI logminerGUI;
    
    private String user=null;
    private String pass=null;
    private String ip;
    private String port;
    private String db;
    
    private String currentServer="Unknow";
    private String userRemote=null;
    private String passRemote=null;
    private String ipRemote;
    private String portRemote;
    private String dbRemote;
    

    
    public Principal() {
        //this.setExtendedState(MAXIMIZED_BOTH);
        this.setTitle("Security Monitor");
        initComponents();
       
        centreWindow(this);
        
        conexion = new Conexion(this);
        connectionPanel.add(conexion);
        connectionPanel.validate();

        tabPanel.setEnabledAt(1,false);
        tabPanel.setEnabledAt(2,false);
    }
    public static void centreWindow(Window frame) {
        Dimension dimension = Toolkit.getDefaultToolkit().getScreenSize();
        int x = (int) ((dimension.getWidth() - frame.getWidth()) / 2);
        int y = (int) ((dimension.getHeight() - frame.getHeight()) / 2);
        frame.setLocation(x, y);
    }

    
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        tabPanel = new javax.swing.JTabbedPane();
        connectionPanel = new javax.swing.JPanel();
        catalogPanel = new javax.swing.JPanel();
        usersPanel = new javax.swing.JPanel();
        logminerPanel = new javax.swing.JPanel();

        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);

        tabPanel.setPreferredSize(new java.awt.Dimension(1071, 500));

        connectionPanel.setLayout(new java.awt.BorderLayout());
        tabPanel.addTab("Connection", connectionPanel);

        catalogPanel.setLayout(new java.awt.BorderLayout());
        tabPanel.addTab("Catalog", catalogPanel);

        usersPanel.setLayout(new java.awt.BorderLayout());
        tabPanel.addTab("Users", usersPanel);

        logminerPanel.setLayout(new java.awt.BorderLayout());
        tabPanel.addTab("Logminer", logminerPanel);

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(tabPanel, javax.swing.GroupLayout.DEFAULT_SIZE, 1051, Short.MAX_VALUE)
                .addContainerGap())
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(tabPanel, javax.swing.GroupLayout.DEFAULT_SIZE, 478, Short.MAX_VALUE)
                .addContainerGap())
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents

    
    public ConectadoGUI getConectado() {
        return conectado;
    }

    
    public void setConectado(ConectadoGUI conectado) {
        this.conectado = conectado;
    }

    
    public Conexion getConexion() {
        return conexion;
    }

    
    public void setConexion(Conexion conexion) {
        this.conexion = conexion;
    }

    
    public Catalogo getCatalogo() {
        return catalogo;
    }
    
    public LogminerGUI getLogminerGUI(){
        return logminerGUI;
    }
    
    public void setLogminerGUI(LogminerGUI l){
        logminerGUI = l;
    }
    
    public void setCatalogo(Catalogo catalogo) {
        this.catalogo = catalogo;
    }

    
    public Users getUsuarios() {
        return usuarios;
    }

    
    public void setUsuarios(Users usuarios) {
        this.usuarios = usuarios;
    }

    
    public javax.swing.JPanel getCatalogPanel() {
        return catalogPanel;
    }

    
    public void setCatalogPanel(javax.swing.JPanel catalogPanel) {
        this.catalogPanel = catalogPanel;
    }

    
    public javax.swing.JPanel getConnectionPanel() {
        return connectionPanel;
    }

    
    public void setConnectionPanel(javax.swing.JPanel connectionPanel) {
        this.connectionPanel = connectionPanel;
    }

    public javax.swing.JTabbedPane getTabPanel() {
        return tabPanel;
    }

    
    public void setTabPanel(javax.swing.JTabbedPane tabPanel) {
        this.tabPanel = tabPanel;
    }

    
    public javax.swing.JPanel getUsersPanel() {
        return usersPanel;
    }

    
    public void setUsersPanel(javax.swing.JPanel usersPanel) {
        this.usersPanel = usersPanel;
    }

   public String getUser() {
        return user;
    }

    /**
     * @param user the user to set
     */
    public void setUser(String user) {
        this.user = user;
    }

    /**
     * @return the pass
     */
    public String getPass() {
        return pass;
    }

    /**
     * @param pass the pass to set
     */
    public void setPass(String pass) {
        this.pass = pass;
    }

    /**
     * @return the ip
     */
    public String getIp() {
        return ip;
    }

    /**
     * @param ip the ip to set
     */
    public void setIp(String ip) {
        this.ip = ip;
    }

    /**
     * @return the port
     */
    public String getPort() {
        return port;
    }

    /**
     * @param port the port to set
     */
    public void setPort(String port) {
        this.port = port;
    }

    /**
     * @return the db
     */
    public String getDb() {
        return db;
    }

    /**
     * @param db the db to set
     */
    public void setDb(String db) {
        this.db = db;
    }

    /**
     * @return the userRemote
     */
    public String getUserRemote() {
        return userRemote;
    }

    /**
     * @param userRemote the userRemote to set
     */
    public void setUserRemote(String userRemote) {
        this.userRemote = userRemote;
    }

    /**
     * @return the passRemote
     */
    public String getPassRemote() {
        return passRemote;
    }

    /**
     * @param passRemote the passRemote to set
     */
    public void setPassRemote(String passRemote) {
        this.passRemote = passRemote;
    }

    /**
     * @return the ipRemote
     */
    public String getIpRemote() {
        return ipRemote;
    }

    /**
     * @param ipRemote the ipRemote to set
     */
    public void setIpRemote(String ipRemote) {
        this.ipRemote = ipRemote;
    }

    /**
     * @return the portRemote
     */
    public String getPortRemote() {
        return portRemote;
    }

    /**
     * @param portRemote the portRemote to set
     */
    public void setPortRemote(String portRemote) {
        this.portRemote = portRemote;
    }

    /**
     * @return the dbRemote
     */
    public String getDbRemote() {
        return dbRemote;
    }

    /**
     * @param dbRemote the dbRemote to set
     */
    public void setDbRemote(String dbRemote) {
        this.dbRemote = dbRemote;
    }

    /**
     * @return the currentServer
     */
    public String getCurrentServer() {
        return currentServer;
    }

    /**
     * @param currentServer the currentServer to set
     */
    public void setCurrentServer(String currentServer) {
        this.currentServer = currentServer;
    }

    /**
     * @param logminerPanel the logminerPanel to set
     */
    public void setLogminerPanel(javax.swing.JPanel logminerPanel) {
        this.logminerPanel = logminerPanel;
    }

    /**
     * @return the logminerPanel
     */
    public javax.swing.JPanel getLogminerPanel() {
        return logminerPanel;
    }


  
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JPanel catalogPanel;
    private javax.swing.JPanel connectionPanel;
    private javax.swing.JPanel logminerPanel;
    private javax.swing.JTabbedPane tabPanel;
    private javax.swing.JPanel usersPanel;
    // End of variables declaration//GEN-END:variables

     

    
}
